package com.zzyl.serve.service.impl;

import java.util.List;
import com.zzyl.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.zzyl.serve.mapper.NursingMapper;
import com.zzyl.serve.domain.Nursing;
import com.zzyl.serve.service.INursingService;

/**
 * 护理项目Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-09-10
 */
@Service
public class NursingServiceImpl implements INursingService 
{
    @Autowired
    private NursingMapper nursingMapper;

    /**
     * 查询护理项目
     * 
     * @param id 护理项目主键
     * @return 护理项目
     */
    @Override
    public Nursing selectNursingById(Long id)
    {
        return nursingMapper.selectNursingById(id);
    }

    /**
     * 查询护理项目列表
     * 
     * @param nursing 护理项目
     * @return 护理项目
     */
    @Override
    public List<Nursing> selectNursingList(Nursing nursing)
    {
        return nursingMapper.selectNursingList(nursing);
    }

    /**
     * 新增护理项目
     * 
     * @param nursing 护理项目
     * @return 结果
     */
    @Override
    public int insertNursing(Nursing nursing)
    {
        nursing.setCreateTime(DateUtils.getNowDate());
        return nursingMapper.insertNursing(nursing);
    }

    /**
     * 修改护理项目
     * 
     * @param nursing 护理项目
     * @return 结果
     */
    @Override
    public int updateNursing(Nursing nursing)
    {
        nursing.setUpdateTime(DateUtils.getNowDate());
        return nursingMapper.updateNursing(nursing);
    }

    /**
     * 批量删除护理项目
     * 
     * @param ids 需要删除的护理项目主键
     * @return 结果
     */
    @Override
    public int deleteNursingByIds(Long[] ids)
    {
        return nursingMapper.deleteNursingByIds(ids);
    }

    /**
     * 删除护理项目信息
     * 
     * @param id 护理项目主键
     * @return 结果
     */
    @Override
    public int deleteNursingById(Long id)
    {
        return nursingMapper.deleteNursingById(id);
    }
}
